package no.saiboten.tourbuilder.bracket.impl;

import java.util.HashMap;
import java.util.Map;

import no.saiboten.tourbuilder.bracket.Bracket;
import no.saiboten.tourbuilder.bracket.BracketDAO;

import org.springframework.stereotype.Component;

@Component
public class BracketDAOImpl implements BracketDAO {

	Map<String, Bracket> bracketHolder;

	public BracketDAOImpl() {
		bracketHolder = new HashMap<String, Bracket>();
	}

	@Override
	public Bracket getBracket(String bracketsId) {
		return bracketHolder.get(bracketsId);
	}

	@Override
	public boolean addBracket(Bracket bracket) {
		bracketHolder.put(bracket.getBracketId(), bracket);
		return true;
	}

	@Override
	public Map<String, Bracket> getAllBrackets() {
		return bracketHolder;
	}

}
